package Home_Work.src.day03;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * 输入某人生日，格式为"yyyy-MM-dd"，输出到现在为止经过了多少周。
 * @author Bonnie
 *
 */
public class Test03 {
	public static void main(String[] args) throws ParseException {
		 long time1 = System.currentTimeMillis();
		 Date date1 = new Date(time1);
		 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		 String nowTime = sdf.format(date1);
		 System.out.println(nowTime);
		 
		 Scanner console = new Scanner(System.in);
		 System.out.println("输入 yyyy-MM-dd 格式的时间");
		 String birthday = console.nextLine();
		 Date bir = sdf.parse(birthday);
		 long time2 = bir.getTime();
		 
		 long count = (time1 - time2) / (7*24*66*60*1000);
		 System.out.println(count);
	}
}
